Skip to content

feat(record-page): an empty field you can edit reads 「设置{字段名}」 and one click fills it; an editable value offers the copy icon - #36385

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-36292-empty-field-set-placeholder
Nov 22, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-36292-empty-field-set-placeholder

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #36292

Requested by Steedos · project thread

repo:objectstack#7 · zhuangjianguo · session_01QsR2jRaJbQ4vqdv4J5peqA

Part of epic #35590 (record page redo). Claim 7075947584 (Premise: corrected); binding linked ruling: #36147 record 7066516044 (option A), shipped by #36234.

Clause-②: yes (widening)
Metadata-protocol: none

The claim's line reads Clause-②: no (expected …) with the instruction to amend it to yes (widening) if a key is added: one key is added, detail.setField, in every @object-ui/i18n pack. No prop, export or schema key is removed or narrowed.

维护者速读

  • 记录页字段区(右侧预览、手机「详情」、整页)里可以编辑的空字段,从「—」变成浅色的「设置某某」,点一下直接进编辑;可编辑的值鼠标移上去右边也有复制图标。
  • 属于记录页重做专题,按维护者「立」的第 4 条(单击进编辑、空字段可点)补齐还没做的部分。
  • 出错时最多是空字段显示的字或复制图标位置不对,不影响保存的数据;撤回这个改动即可恢复原样。
  • 无

What changes

Measured on origin/main b3bcfef before writing anything (the card's items, one by one, on the synthesized record page's field area, which is DetailSection's frameless face in all of the side preview, the phone 「详情」 tab, the pinned left column and a full page alone):

Card item On main before this PR This PR
1. Single click enters edit Already shipped by #36234: the row's onClick on the frameless face calls onEnterInlineEdit (guarded by clickBelongsElsewhere) unchanged
2a. Links, phone, email, chips: a click on the text opens it, the rest of the value edits Already shipped by #36234: clickBelongsElsewhere hands a click on an a, a button or a role=link to that element unchanged
2b. Hover copy icon on any value Half: read-only values only. The button block was canInlineEditField ? pencil : copyOffered ? copy : null, so an editable value had no copy icon an editable value on the frameless face also draws the copy button (hover / keyboard focus, pointer-coarse:hidden per ruling item 1); the keyboard-only pencil stays beside it
3. Empty editable value reads 「设置某某」, one click edits Missing: every empty value drew the shared EmptyValue dash an empty value with canInlineEditField on the frameless face reads t('detail.setField', { field }) in text-muted-foreground/70; the row's existing click enters edit. Read-only, no write grant, record not inline-editable: the dash, unchanged
4. "Show N empty fields" fold unchanged; shown, empty rows read 「设置某某」 fold already shipped by #36234 (EmptyFieldsRow) shown rows now read the placeholder
5. Full page, side preview, phone alike the three places are the one frameless face (DefaultRecordPageContext) follows from the one face
  • Authored record pages (and every other DetailView) keep their faces, as feat(record-page): the field area is one list in the side preview, on a phone and in the pinned left column (#36147) #36234 left them: double-click and the pencil, and the dash on an empty value. A "set" placeholder there would invite a single click that does nothing. Raised as an open question in the report, not built.
  • i18n: detail.setField in all eleven packs (en Set {{field}}, zh-Hans 设置{{field}}, zh-Hant 設定{{field}}, ja {{field}}を設定, ko {{field}} 설정, de {{field}} festlegen, fr Définir {{field}}, es Establecer {{field}}, pt-BR Definir {{field}}, ru Указать «{{field}}», ar تعيين {{field}}).
  • Changeset .changeset/36292-record-field-set-placeholder.md (@object-ui/plugin-detail, @object-ui/i18n: patch).

Files to read first, by risk:

  1. ui/packages/plugin-detail/src/DetailSection.tsx, the displayValue closure's new first branch (isEmpty && frameless && canInlineEditField), where the placeholder replaces the dash.
  2. Same file, the button block at the end of the read row: the pencil and the copy button are now siblings, the copy one gated copyOffered && (!canInlineEditField || frameless).
  3. ui/packages/plugin-detail/src/__tests__/DetailSection.fieldList-36147.test.tsx, the two new top-level describe blocks.

Tests

New pins in the existing field-list harness (two top-level describes, objectstack#36292):

  • an empty editable value reads Set Note / Set Phone and a click on it enters edit with note;
  • CONTROL: a non-empty value reads as before;
  • CONTROL: a read-only field keeps the No value placeholder and its click does not enter edit;
  • CONTROL: a record that is not inline-editable keeps the placeholder on every empty row;
  • CONTROL: a field the caller may not write (a real MePermissionsProvider envelope, editable: false) keeps the placeholder;
  • CONTROL: off the field face (the section's own empty-fields toggle opened, so the row is on screen) the placeholder is the dash;
  • through a real I18nProvider in zh-CN the placeholder reads 设置备注;
  • the copy button sits beside an editable value, hidden at rest, revealed on hover / focus, pointer-coarse:hidden, copies Atlas deal and does not enter edit; CONTROL: an empty editable value has none; CONTROL: off the field face an editable row keeps the pencil alone.
Local runs

All under scripts/pm/os-verify-lock.sh, vitest from ui/ with --maxWorkers=1:

  • vitest run packages/plugin-detail/src/__tests__/DetailSection.fieldList-36147.test.tsx: Tests 25 passed (25), VERDICT command-exit 0.
  • vitest run packages/plugin-detail/ packages/i18n/ (head 7b0e4d41; the one later commit 2c35661f edits only the changeset): Test Files 514 passed | 1 skipped (515), Tests 5790 passed | 31 skipped (5821), VERDICT command-exit 0.
  • pnpm --filter @object-ui/plugin-detail --filter @object-ui/i18n run type-check (both tsc --noEmit and tsc -p tsconfig.test.json): VERDICT command-exit 0.
Ablations (one per changed behaviour, through scripts/ablation-replace.mjs)

Both ran on head 2c35661f inside one hold of the shared lock; each leg is the pin file above, the restore proven by the tool (blob 932402dfeeb2 == HEAD, git diff HEAD empty).

  1. Placeholder branch disabled (if (isEmpty && frameless && canInlineEditField) { to if (false && isEmpty && frameless && canInlineEditField) {; mutation landed, anchor 1 to 0, blob 932402dfeeb2 to dfd20d6b8e8c): Tests 4 failed | 21 passed (25) — the "Set Note" pin, the read-only and no-write-grant controls (each also asserts the remaining Set Phone) and the zh-CN pin. Restored.
  2. Copy button narrowed back to read-only rows ({copyOffered && (!canInlineEditField || frameless) && ( to {copyOffered && !canInlineEditField && (; blob 932402dfeeb2 to d71eb76d821d): Tests 1 failed | 24 passed (25) — the editable-value copy pin. Restored.

Unmutated, the same pin file: Tests 25 passed (25) (the local run above).

Derived gate families (dispatch-gates --commands, 41)

All 41 families node scripts/pm/dispatch-gates.mjs --commands derives for this diff ran locally on head 7b0e4d41, every one exit 0 (pnpm check:type-check-debt first answered exit 3, PREREQUISITE NOT MET because its closure build never got a lock turn; re-run under the lock: TCDEBT_EXIT=0, re-measure OK; pnpm --dir ui exec vitest run scripts/: Tests 5127 passed | 2 skipped). --ran reconciliation: 41 derived famil(ies) accounted for — 41 run, 0 NOT-MEASURED (a DERIVED zero — all 41 recorded an exit code and none of them is 3). On the final head 2c35661f (changeset-only commit) the changeset families were re-run, exit 0 each: check-adr-0087-registration, check-changeset-no-major, check-empty-changeset, check:nul-bytes, check:published-files. The required CI contexts (Test UI, Type Check UI, Lint UI, Lint & Repo Gates, …) are CI's, not re-run here.

Acceptance notes

  • Screenshots the card asks for, taken on head 2c35661f in a live CRM example app (examples/app-crm, objectstack dev --fresh) with the Console dev server built from that head; Chromium 1440x900 at deviceScaleFactor 2, UI language zh-CN, the lead "Marie Curie" after 「显示 2 个空字段」. Hosted on the side branch claude/issue-36292-evidence (never merged), not on this branch. No read-only empty field is cheaply reachable on this record (every empty body field is editable for the admin), so the 「—」 control rests on the jsdom pins above.

    Full record page, empty editable fields read 「设置分配给」 / 「设置转化商机」:

    Full page: empty fields read 设置分配给 and 设置转化商机

    Full record page, after one click on 「设置转化商机」 (the inline edit session opens):

    Full page: edit after one click

    Side preview, the same two placeholders:

    Side preview: empty fields read 设置分配给 and 设置转化商机

    Side preview, after one click on 「设置转化商机」:

    Side preview: edit after one click

  • Not re-verified in a browser: Enter / click-away saves and Esc cancels; those are the existing inline-edit session's keys, untouched here.

  • The card's 没有核对的 items (approval-locked records; tap-vs-scroll on a phone) are unchanged by this PR: a locked record is not inline-editable, so its empty fields keep the dash.

Verification

Two minutes: on a default record page (HotCRM 线索, or any object without an authored record page) open the side preview, click 「显示 N 个空字段」. Expected: each empty field you can edit reads light 「设置字段名」; one click opens its editor. A read-only empty field still reads 「—」. Hover a filled editable value: a copy icon appears at its right, and clicking it copies without entering edit.


Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01QsR2jRaJbQ4vqdv4J5peqA

…t <label>, and an editable value offers the copy button

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jRaJbQ4vqdv4J5peqA
…alue's copy button; changeset

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jRaJbQ4vqdv4J5peqA
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 22, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jRaJbQ4vqdv4J5peqA

Final head · 2026-11-22T09:29Z · 2c35661f855033a8c5d950b06e114b56298f0b62 — CI complete on this head with no failed suite. The area will not push again unless a review asks.
Review owed: L1 (l1-review-checklist.md, L1-d, requested through the seat) at this head, plus the Clause-②: yes (widening) declaration review at TIER_DEFAULT (one new published @object-ui/i18n key, detail.setField; claim amendment on #36292). 211 changed lines, so not area self-review.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract-review-claim: session_01QsR2jTeURPvEm465RcoYEC · head 2c35661 · 2026-11-22T09:30Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf

L1 ACCEPT · head 2c35661f855033a8c5d950b06e114b56298f0b62 · 2026-11-22T09:32Z

维护者速读

席位核对

  • 形态:l1-face --pr 36385 CLEAN,13 项都没有标记;draft、base main、Fixes #36292。卡的 5 条逐条对上:正文里的表格写明第 1、2a、4 条在 main b3bcfef 上已由 feat(record-page): the field area is one list in the side preview, on a phone and in the pinned left column (#36147) #36234 交付,2b 和 3 由本 PR 补齐;第 5 条成立,因为三处用的是同一个 frameless 字段面(useDefaultRecordPage(),DetailSection.tsx:264;手机分组行只在非 frameless 时走,:882)。所以用 Fixes 是对的。改动 14 个文件 +204 −7;check-governed-merges 判定 NOT governed,211 行。
  • 实现读法:占位分支的条件是 isEmpty && frameless && canInlineEditField。canInlineEditField 已经包含只读、计算字段、系统字段、排除内联编辑、无写权限、无 onEnterInlineEdit 这几种情况,所以卡上要求「只读或无权限仍显示 —」的地方都保持原样。按钮块从三元式拆成两个兄弟元素:非 frameless 面上,可编辑的仍只有铅笔,只读的仍只有复制,和以前一样;frameless 面上,可编辑的同时有铅笔和复制。canCopy = hasCellValue(value)(:841),所以空值不出复制图标。fieldLabelText 只是挪到前面声明,值没变。区里答 A(自己搭的记录页不动,范围按裁决 7066516044),本 PR 照做。
  • i18n:detail.setField 在 11 个语言包里都有,我逐个读过,译文都带 {{field}},语序符合各自语言(ja「を設定」、de「festlegen」在后、ru 用书名号)。
  • changeset 逐句核:相符。
  • 测试证据:在现有字段列表测试里新增两个 describe,包括占位和点击进编辑、5 条对照(有值、只读、不可内联编辑、无写权限且用真实 MePermissionsProvider、非字段面),zh-CN 用真实 I18nProvider 显示「设置备注」,另有复制按钮的钉和两条对照。两处消融:关掉占位分支,4 条变红;把复制按钮收回到只读行,1 条变红;恢复后按 blob 证明一致。这些用例我没有在本地重跑,读的是报告和 CI。
  • 门禁 check-runs @ 2c35661f:45 success · 13 expected skip · 0 failed · 0 pending;mergeable_state clean。
  • 接受的偏差:卡验收要的「空字段和编辑中的截图」没有做,正文如实写成 NOT MEASURED,理由是这台机器上没有可跑的 Console。行为已由 jsdom 钉住,所以我不因此 REWORK,改成落地条件。
  • 范围外去向:无。
  • 落地条款:非受管,211 行 ≤ 3000;等席位的 L2 PASS,以及记录区把截图补进 PR 正文(改正文不动 head,不用重审),之后由记录区 ready + auto-merge。

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 2c35661f855033a8c5d950b06e114b56298f0b62
Local-runs: none

Face: declaration (Clause-②: yes (widening) on the PR body and the changeset; no published schema and no governed path in the 14-path diff, merge base b3bcfefcb8). Inputs read: card #36292 body and all four comments (triage 7074940287, claim 7075947584, os-dev-report 7076947391, claim amendment 7076962791), the linked ruling 7066516044 on #36147, the PR body and file list, the net diff against main, and the check-runs on this head: every check-run concluded success or skipped (conditional legs), none failed or is pending; Check Changeset, Governed Surface Queue Guard, Test UI (16/16), Type Check UI, Lint UI and Lint & Repo Gates all success.

① Derived judgments

  1. @object-ui/i18n: one new key, detail.setField, added to each of the eleven packs the package ships (ar, de, en, es, fr, ja, ko, pt-BR, ru, zh-Hans, zh-Hant; the locales directory holds no twelfth pack), each beside detail.clickToEdit in the detail group, each interpolating {{field}}, the param the one caller passes. Public-surface change: the exported TranslationKeys type (typeof en) gains one member. Additive only; no key removed, renamed or re-meant. Named right: a widening.
  2. @object-ui/plugin-detail, DetailSection: no prop, export or schema key added or removed; no accept-set change. The rendering change is behind frameless (useDefaultRecordPage() && !isPrintPage) at both points: (a) an empty value with canInlineEditField reads t('detail.setField', { field }) instead of the shared EmptyValue dash; (b) the copy button is now drawn beside the keyboard-only pencil on an editable frameless row (copyOffered && (!canInlineEditField || frameless)). copyOffered still carries !isMaskedField, and the button still carries pointer-coarse:hidden, so the ruling 7066516044 invariants (masked and ungranted fields not copyable, no copy icon on phone) hold. The button is a sibling of the value element, outside its click handler, so a copy does not enter edit (pinned). fieldLabelText is hoisted above displayValue, not changed. Named right: no contract change in this package beyond what it renders.
  3. Accept-set at the metadata layer: none. Nothing a metadata author writes is added, refused or re-meant; the face is the default page's, not an authorable key (ADR-0085, as the DefaultRecordPageContext docblock states). Metadata-protocol: none is right.

② Semver level

  • Clause-②: yes (widening) is right: @object-ui/i18n is published and its pack shape widens by one key; nothing narrows, so no (narrowing) arm, no BREAKING banner and no ADR-0087 disposition are owed. The claim's original no (expected) was amended to yes (widening) on the card (7076962791) from the dev's measurement, and the PR body and the changeset both carry the amended line, line-initial.
  • Metadata-protocol: none is right (see ① 3), on the PR body and the changeset.
  • Level: AGENTS.md Post-Task Checklist 3: none takes patch, and a non-protocol widening ships patch. The changeset .changeset/36292-record-field-set-placeholder.md names exactly the two packages the diff moves, @object-ui/plugin-detail and @object-ui/i18n, both patch. Matches. Check Changeset is green on this head.

③ Boundary flags

  • Open question (os-dev-report 7076947391): should items 1 to 3 reach authored record pages and other DetailView hosts? The area answered A (7076962791): authored pages keep the double-click, the pencil and the dash, inside ruling 7066516044 scope. The diff stays inside A. Both new branches are gated on frameless, which is true only under DefaultRecordPageContext, and that context is provided only (i) by RecordPageColumns, which RecordDetailView builds only when pageColumnsEligible (!assignedPage && !namedPageBlocked), and (ii) around the fallback tab strip with the value !assignedPage && !namedPageBlocked. An authored page, the drawer and overlay panel, a dashboard and a standalone DetailView read the default false and keep their faces. The PR pins the control (off the field face an empty editable value keeps the dash, and an editable row keeps the pencil alone with no copy button). Answered, no escalation; option B would widen a maintainer-scoped ruling and is correctly not built.
  • Dev deviations (4): (1) PR-body line order and (2) by-symbol citations are process items, not contract. (3) Screenshots the card's acceptance asks for are NOT MEASURED; that belongs to L1 and acceptance, not to this face, and is noted here only so it is not lost. (4) The Clause-② amendment is checked above and holds.
  • Card 没有核对的 items (approval-locked records; tap versus scroll on a phone): not moved by this diff. A locked record is not inline-editable, so its empty fields keep the dash; the single tap itself shipped in feat(record-page): the field area is one list in the side preview, on a phone and in the pinned left column (#36147) #36234.
  • SQL push-down (Prime Directive 5): the diff reads no data, adds no query, no id materialisation and no in-app join. Nothing to push down; no finding.
  • Findings, graded:
    • nit: the changeset headline says feat(console) while the two packages it ships are @object-ui/plugin-detail and @object-ui/i18n; cosmetic, the bullets are accurate.
    • nit: the placeholder span carries no aria-label, so a screen reader hears the visible text 「设置备注」 and no longer the dash's "No value" name on an editable empty row. The visible text is arguably the clearer name; no contract effect.
    • No must-fix, no should-fix.

Implemented-by: claude/issue-36292-empty-field-set-placeholder
Reviewed-by: session_01QsR2jTeURPvEm465RcoYEC

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jRaJbQ4vqdv4J5peqA

Landing · 2026-11-22T10:05Z · head 958a795331e0d945c44b9136514f0afebcf45758 (clean main sync of reviewed 2c35661f through the relay pr_update_branch; same patch, L1 ACCEPT 7077216284 and L2 PASS 7077237896 stand).

probe reading
check-governed-merges.mjs --pr 36385 NOT governed · 211 lines ≤ 3000
K (first-parent commits merge-base → origin/main) 21 at 2c35661f ⇒ synced; 1 after the sync
check-runs @ 958a7953 every suite completed, none failed
L1 landing condition screenshots now in the PR body (relay issue_patch, byte-identical read-back): empty editable fields read 「设置分配给」/「设置转化商机」 on the full page and the side preview, one click opens edit (examples/app-crm, zh-CN, 1440×900 @2x)
L2 nits changeset headline scope, placeholder aria-label: not pushed (would move the reviewed head); carried to the next PR touching this face

State: ready + auto-merge now; Fixes #36292 closes the card on merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 22, 2026 10:06
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit 42e4096 Nov 22, 2026
63 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-36292-empty-field-set-placeholder branch November 22, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

记录页字段区:点一下值就进编辑(现在要双击);空字段显示成「设置某某」,点一下直接填

2 participants